package com.qingfeng.basic_lib.event.com.qingfeng.basic_lib.net

import android.content.Context
import android.util.AttributeSet
import android.view.ViewGroup
import androidx.annotation.AttrRes
import com.qingfeng.basic_lib.event.com.qingfeng.basic_lib.basic.IBaseResponse

open class ResponseThrowable : Exception{
    var code: Int
    var errMsg: String

    constructor(error: ERROR, e: Throwable? = null) : super(e){
        code = error.getKey()
        errMsg = error.getValue()
    }

    constructor(code: Int, msg: String, e: Throwable? = null) : super(e) {
        this.code = code
        this.errMsg = msg
    }

    constructor(base: IBaseResponse<*>, e: Throwable? = null) : super(e) {
        this.code = base.code()
        this.errMsg = base.msg()
    }
}

